package com.xxgc.demo.controller.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

@Schema(name = "用户注册VO对象",description = "用户注册VO对象")
@Data
public class UserInfoRegisterVO {

    @NotNull(message = "用户名不能为空")
    @Size(min = 2,max = 6,message = "用户名长度在2-6位")
    @Pattern(regexp="^[\\u4e00-\\u9fa5a-zA-Z0-9]+$",message = "用户名不能用特殊字符，只能中文、字母、或数字")
    @Schema(description = "用户名",requiredMode = Schema.RequiredMode.REQUIRED)
    private String nickName;

    @NotNull(message = "密码不能为空")
    @Size(min = 8,max = 20,message = "用户名长度在8-20位")
    @Pattern(regexp="^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).+$",message = "密码必须包含大小写字母和数字")
    @Schema(description = "密码",defaultValue = "123456",requiredMode = Schema.RequiredMode.REQUIRED)
    private String passWord;

    @NotNull(message = "电话号不能为空")
    @Pattern(regexp="^1[3-9]\\d{9}$",message = "请输入11位中国电话号码")
    @Schema(description = "电话号码",requiredMode = Schema.RequiredMode.REQUIRED)
    private String phone;
}
